package com.txunda.zhuohired.fgt.user;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.ants.theantsgo.view.inScroll.ListViewForScrollView;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;
import com.txunda.zhuohired.R;
import com.txunda.zhuohired.adapter.user.news.NewsAdapter;
import com.txunda.zhuohired.aty.user.news.SystemInformAty;
import com.txunda.zhuohired.base.BaseFgt;

/**
 * 创建人： Txd_Cjh
 * 创建时间： 2018/2/26 14:57
 * 功能描述：消息页
 * 联系方式：jiahuanchen@126.com
 */

public class NewsFgt extends BaseFgt {
    /**
     * 标题
     */
    @ViewInject(R.id.tv_layout_white_center)
    private TextView tv_layout_white_center;
    /**
     * 返回键
     */
    @ViewInject(R.id.iv_layout_white_back)
    private ImageView iv_layout_white_back;
    /**
     * listView
     */
    @ViewInject(R.id.lv_fgt_news)
    private ListViewForScrollView lv_fgt_news;

    private NewsAdapter newsAdapter;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    @OnClick({R.id.ll_news_system_inform})
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.ll_news_system_inform://系统通知
                startActivity(SystemInformAty.class, null);
                break;
        }
    }

    @Override
    protected void immersionInit() {
        showStatusBar(R.id.layout_white_head);
        tv_layout_white_center.setText("消息");
        iv_layout_white_back.setVisibility(View.GONE);
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.fgt_news;
    }

    @Override
    protected void initialized() {

    }

    @Override
    protected void requestData() {
        initAdapter();
    }

    private void initAdapter() {
        newsAdapter = new NewsAdapter(getActivity());
        lv_fgt_news.setAdapter(newsAdapter);
    }
}
